/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.cmc.service.merchant.model.impl;

import com.cmc.service.merchant.model.AgentEntry;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing AgentEntry in entity cache.
 *
 * @author ntcuong1
 * @see AgentEntry
 * @generated
 */
public class AgentEntryCacheModel implements CacheModel<AgentEntry>,
	Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(45);

		sb.append("{agentId=");
		sb.append(agentId);
		sb.append(", creatorUserId=");
		sb.append(creatorUserId);
		sb.append(", companyId=");
		sb.append(companyId);
		sb.append(", createDate=");
		sb.append(createDate);
		sb.append(", modifiedDate=");
		sb.append(modifiedDate);
		sb.append(", type=");
		sb.append(type);
		sb.append(", code=");
		sb.append(code);
		sb.append(", firstName=");
		sb.append(firstName);
		sb.append(", middleName=");
		sb.append(middleName);
		sb.append(", lastName=");
		sb.append(lastName);
		sb.append(", prefixId=");
		sb.append(prefixId);
		sb.append(", suffixId=");
		sb.append(suffixId);
		sb.append(", male=");
		sb.append(male);
		sb.append(", birthdayMonth=");
		sb.append(birthdayMonth);
		sb.append(", birthdayYear=");
		sb.append(birthdayYear);
		sb.append(", birthdayDay=");
		sb.append(birthdayDay);
		sb.append(", jobTitle=");
		sb.append(jobTitle);
		sb.append(", email=");
		sb.append(email);
		sb.append(", merchantId=");
		sb.append(merchantId);
		sb.append(", loginable=");
		sb.append(loginable);
		sb.append(", userId=");
		sb.append(userId);
		sb.append(", screenName=");
		sb.append(screenName);
		sb.append("}");

		return sb.toString();
	}

	public AgentEntry toEntityModel() {
		AgentEntryImpl agentEntryImpl = new AgentEntryImpl();

		agentEntryImpl.setAgentId(agentId);
		agentEntryImpl.setCreatorUserId(creatorUserId);
		agentEntryImpl.setCompanyId(companyId);

		if (createDate == Long.MIN_VALUE) {
			agentEntryImpl.setCreateDate(null);
		}
		else {
			agentEntryImpl.setCreateDate(new Date(createDate));
		}

		if (modifiedDate == Long.MIN_VALUE) {
			agentEntryImpl.setModifiedDate(null);
		}
		else {
			agentEntryImpl.setModifiedDate(new Date(modifiedDate));
		}

		if (type == null) {
			agentEntryImpl.setType(StringPool.BLANK);
		}
		else {
			agentEntryImpl.setType(type);
		}

		if (code == null) {
			agentEntryImpl.setCode(StringPool.BLANK);
		}
		else {
			agentEntryImpl.setCode(code);
		}

		if (firstName == null) {
			agentEntryImpl.setFirstName(StringPool.BLANK);
		}
		else {
			agentEntryImpl.setFirstName(firstName);
		}

		if (middleName == null) {
			agentEntryImpl.setMiddleName(StringPool.BLANK);
		}
		else {
			agentEntryImpl.setMiddleName(middleName);
		}

		if (lastName == null) {
			agentEntryImpl.setLastName(StringPool.BLANK);
		}
		else {
			agentEntryImpl.setLastName(lastName);
		}

		agentEntryImpl.setPrefixId(prefixId);
		agentEntryImpl.setSuffixId(suffixId);
		agentEntryImpl.setMale(male);
		agentEntryImpl.setBirthdayMonth(birthdayMonth);
		agentEntryImpl.setBirthdayYear(birthdayYear);
		agentEntryImpl.setBirthdayDay(birthdayDay);

		if (jobTitle == null) {
			agentEntryImpl.setJobTitle(StringPool.BLANK);
		}
		else {
			agentEntryImpl.setJobTitle(jobTitle);
		}

		if (email == null) {
			agentEntryImpl.setEmail(StringPool.BLANK);
		}
		else {
			agentEntryImpl.setEmail(email);
		}

		agentEntryImpl.setMerchantId(merchantId);
		agentEntryImpl.setLoginable(loginable);
		agentEntryImpl.setUserId(userId);

		if (screenName == null) {
			agentEntryImpl.setScreenName(StringPool.BLANK);
		}
		else {
			agentEntryImpl.setScreenName(screenName);
		}

		agentEntryImpl.resetOriginalValues();

		return agentEntryImpl;
	}

	public long agentId;
	public long creatorUserId;
	public long companyId;
	public long createDate;
	public long modifiedDate;
	public String type;
	public String code;
	public String firstName;
	public String middleName;
	public String lastName;
	public int prefixId;
	public int suffixId;
	public boolean male;
	public int birthdayMonth;
	public int birthdayYear;
	public int birthdayDay;
	public String jobTitle;
	public String email;
	public long merchantId;
	public boolean loginable;
	public long userId;
	public String screenName;
}